let express=require('express');
let router=express.Router();
let mongoose=require('mongoose');

router.post('/query',async function(req,resp){
    let {studentId}=req.body;

    let re=await mongoose.model('testedsModel').find({
        studentId
}).populate('testId');

    if(re){
        resp.send({
            code:1,
            message:'获取已做试卷成功',
            data:re
        })
    }else{
        resp.send({
            code:2,
            message:'获取已做试卷失败'
        })
    }
})

module.exports=router; 